package com.company;

import java.util.HashSet;
import java.util.Random;
import java.util.Scanner;

public class NGuessNumber {
    public HashSet<Integer> generateAnswer(){
        HashSet<Integer> hashSet = new HashSet<Integer>();
        Random random = new Random();
        while (hashSet.size() < 4){
            int num = random.nextInt((9 - 0) + 1) + 0;
            hashSet.add(num);
        }
        System.out.println(hashSet);
        return hashSet;
    }

    public int[] getPlayerInput(){
        int[] ints = new int[4];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < ints.length; i++) {
            ints[i] = scanner.nextInt();
        }
        return ints;
    }

    public boolean compareGuessAnswer(){
        NGuessNumber nGuessNumber = new NGuessNumber();
        for (int n: nGuessNumber.generateAnswer()) {
            for (int a:nGuessNumber.getPlayerInput()) {
                if (n==a){
                    return true;
                }
                return false;
            }
        }
        return false;
    }
}
